package com.college.userInfo.mapper;

import com.college.common.pojo.ao.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(User user);

    int insertSelective(User user);

    User userLogin(@Param("accountNumber") String accountNumber, @Param("userPassword") String userPassword);

    User selectByPrimaryKey(Long id);

    Long selectByUserName(String nickname);

    List<User> getUserList();

    List<User> findUserByList(List<Long> idList);

    List<User> getNormalUser(int begin, int nums);

    List<User> getBanUser(int begin, int nums);

    // 通过账户查找用户
    List<User> getUserByNumber(String searchValue, int mode);

    int countNormalUser();

    int countBanUser();

    int updateByPrimaryKeySelective(User user);

    int updateByPrimaryKey(User user);

    int updatePassword(@Param("newPassword") String newPassword,
                       @Param("oldPassword") String oldPassword,@Param("id") Long id);
}